import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random

import sim, main, sim_items
from util import *

class Potion(sim_items.Potion):
    def __init__(self):
        sim_items.Potion.__init__(self, "speed", "!",
                ('go', 'more'),
                idDescription="Distilled from the adrenaline gland of a "\
                    "quickling, this fizzy potion changes the very way one "\
                    "experiences time. One's use of every single microsecond "\
                    "is optimized, allowing for the execution of legendary "\
                    "feats of heroism. In excess, however, the potion can "\
                    "take a hefty toll on the circulatory system...")

    def quaff(self, quaffer):
        self.amount = random.randint(9,11)
        self.duration = 30000

        main.schedule(sim.Event('increase stat', main.schedule.time, (quaffer,
            'speedMod', self.amount), dests=[quaffer]))
        main.schedule(sim.Event('decrease stat', main.schedule.time +\
            self.duration, (quaffer, 'speedMod', self.amount), dests=[quaffer]))
        main.schedule(sim.Event('statusNote+', main.schedule.time, (quaffer,
            'speed'), dests=[quaffer]))
        main.schedule(sim.Event('statusNote-', main.schedule.time +\
            self.duration, (quaffer, 'speed'), dests=[quaffer]))
        quaffer.identify(self)

#========================================
thingClass = Potion


